import http from '../utils/request';

const { get, post } = http('admin');

// 获取所有菜单，树形结构
export const allMenuTree = params => get('/api/user/sysMenu/allMenuTree', params);
// 获取菜单详情
export const getMenuInfo = params => get(`/api/user/sysMenu/getMenuInfo/${params.menuId}`);
// 添加菜单
export const createMenu = params => post('/api/user/sysMenu/createMenu', params);
// 删除菜单
export const deleteMenu = params => post('/api/user/sysMenu/deleteMenu', params);
// 更新菜单节点信息
export const updateMenu = params => post('/api/user/sysMenu/updateMenu', params);
// 根据角色名字请求菜单
export const findMenuByRole = params => get(`/api/user/sysMenu/findMenuByRole/${params.role}`);
// 根据角色名字请求菜单
export const queryRoleMenus = params => get(`/api/user/sysMenu/queryRoleMenus/${params.roleId}`);
// 保存角色的菜单
export const saveRoleMenus = params => post('/api/user/sysMenu/saveRoleMenus', params);


